#ifndef __SERVER_H
#define __SERVER_H
#include<wx/wx.h>
#include<wx/socket.h>
#include"SahovskaPloca.h"
class Frame;
enum
{
	SOCKET_ID,
	SERVER_ID=100,
	SOCKET_ID_SERVER
};
class Server : public wxEvtHandler
{
private:
	wxSocketServer *m_server;
	Frame *m_frame;
	SahovskaPloca* _sahovskaPloca;
	//wxSocketBase *sock;
public:
	wxSocketBase* sock;
	Server();
	~Server();
	bool GetStatus();
	void init();
	void SetFrame(Frame *frame);
	void OnServerEvent(wxSocketEvent& event);
	void OnSocketEvent(wxSocketEvent& event);
	bool IsConnected();
	void RcvCoord(wxSocketBase *);
	void SendCoord(int x1,int y1,int x2,int y2);
	void SendText(wxString text);
	wxSocketBase *GetSocket();
	DECLARE_EVENT_TABLE()
};

#endif